home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-12 | 1.8 KB | 55 lines | [TEXT/MPS ] |
- # Macintosh Programmer’s Toolbox Assistant
- # Copyright © 1986-1995 Apple Computer, Inc. All rights reserved.
- #
- # -- brain surgery provided by the MPW Gurus, 1/12/95
- #
- # ------------------------------- #
- # UserStartup•MPTA
- # ------------------------------- #
- #
- # Put this file in the same folder as the MPW Shell.
- #
- # This startup script defines the {MPTA_Location} and {MPTA_AppName} variables
- # for use by the MPTA_MPWAccess script.
- #
- # It also adds a menu called "MPTA" to the MPW Shell menu bar with items that
- # let you look up the description of a toolbox routine or return the C template
- # for a toolbox routine.
- #
-
- set saveExit {Exit}
- set exit 0
- set hasSendAE "`which SendAE ≥dev:null`"
- if "{hasSendAE}" ≠ ""
- Addmenu "MPTA" "Look up/E" ('MPTA_MPWAccess Lookup')
- Addmenu "MPTA" "Template/1" ('MPTA_MPWAccess GetTemplate')
-
- # Set the location of the Macintosh Programmer’s Toolbox Assistant folder.
- # If the folder can’t be found, prompt the user for it and remember
- # where the folder was found.
-
- if ¬ "{MPTA_Location}" && "`Exists "{ShellDirectory}"MPTA_FullPathName`"
- Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
- End
-
- If ¬ "`Exists "{ShellDirectory}"MPTA_FullPathName`" || ¬ "`Exists "{MPTA_Location}"`"
- Set exit 0
- Set temp "{ShellDirectory}"
- Set temp "`(GetFileName "{temp}" -b "Here It Is" -t APPL -q -m "Locate the QuickView application.") ≥ dev:null`"
- IF "{temp}"!= ""
- Echo -n "{temp}" > "{ShellDirectory}"MPTA_FullPathName
- END
- set exit 1
- END
-
- Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
- (evaluate "{MPTA_Location}" =~ /(([¬:]+:)*)(≈)®1/ ) > Dev:Null
- Set MPTA_AppName "{®1}"
- Export MPTA_Location MPTA_AppName
- else
- Alert "Macintosh Programmer’s Toolbox Assistant cannot locate the ‘SendAE’ tool. Please reinstall MPTA properly."
- end
-
- set exit {saveExit}
- unset hasSendAE saveExit
-